﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:drawing="clr-namespace:DeepEarth.Toolkit.Drawing">

    <Style TargetType="drawing:Label">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="drawing:Label">
                    <Grid HorizontalAlignment="Center" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5">
                        <Grid.RenderTransform>
                            <CompositeTransform x:Name="PART_LabelCompositeTransform" ScaleX="1" ScaleY="1" TranslateX="{TemplateBinding OffsetX}" TranslateY="{TemplateBinding OffsetY}" />
                        </Grid.RenderTransform>
                        <Canvas x:Name="PART_LabelContainer" HorizontalAlignment="Center" VerticalAlignment="Center">
                            <Border VerticalAlignment="Stretch" Background="#FF2D2D2D" CornerRadius="8,8,8,8" BorderBrush="#FF626262" BorderThickness="2,2,2,2" RenderTransformOrigin="0.5,0.5" Opacity="0.8">
                                <TextBlock FontSize="15" Foreground="White" x:Name="PART_Label" Text="{TemplateBinding Text}"></TextBlock>
                            </Border>
                        </Canvas>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>